<html>
<head><meta charset="utf-8"><title>rc diagnostic item · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/rc.20diagnostic.20item.html">rc diagnostic item</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217583089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/rc%20diagnostic%20item/near/217583089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/rc.20diagnostic.20item.html#217583089">(Nov 23 2020 at 02:21)</a>:</h4>
<p>Why does <code>Rc</code> not have a diagnostic item in tests? From the source:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#[cfg_attr(not(test), rustc_diagnostic_item = </span><span class="s">"Rc"</span><span class="cp">)]</span><span class="w"></span>
</code></pre></div>



<a name="217583709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/rc%20diagnostic%20item/near/217583709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/rc.20diagnostic.20item.html#217583709">(Nov 23 2020 at 02:37)</a>:</h4>
<p>My guess is that it's one of the many not(test) pieces in libstd because of the mess of linking std and libtest into the same executable</p>



<a name="217583716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/rc%20diagnostic%20item/near/217583716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/rc.20diagnostic.20item.html#217583716">(Nov 23 2020 at 02:37)</a>:</h4>
<p>i.e., rustc sees a diagnostic item for Rc coming from libtest rather than liballoc/libstd, so if we specify it on both it causes problems</p>



<a name="218128753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/rc%20diagnostic%20item/near/218128753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/rc.20diagnostic.20item.html#218128753">(Nov 27 2020 at 20:59)</a>:</h4>
<p>Ah, okay. Thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>